clear all
set more off

local path0="C:\Dropbox\GeneticsProject (1)\REStat\round_accepted_replication_files\"
local path1="C:\Dropbox\GeneticsProject (1)\REStat\round_accepted_replication_files\outregs"


cd "`path0'workfiles"

use completed_data, clear

			
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Alternative measures of culture: Schwartz
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
foreach var in sch_embedded sch_affauton sch_intelauton { 
	*** OLS
	reg pwt_ln_rgdpwok `var', robust 
	if "`var'"=="sch_embedded" {
	outreg2 `var' using "`path1'\RR_appendix_table_E1.txt" , ///
		replace bdec(3) rdec(3) aster nocons nolabel ctitle("OLS") 
	}
	else {
	outreg2 `var' using "`path1'\RR_appendix_table_E1.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("OLS") 
	}

	*** IV	
	ivreg2 pwt_ln_rgdpwok (`var' = distM_UK), robust ffirst
	matrix A=e(first)
	local R2first=A[2,1]
	local Ffirst =A[3,1]
	outreg2 `var' using "`path1'\RR_appendix_table_E1.txt" , ///
		append bdec(3) rdec(3) aster nocons nolabel ctitle("IV") ///
		addstat("1st stage F-stat", `Ffirst',"Partial R2",`R2first')
		
}	
		
